﻿using System.Collections;
using System.Collections.Generic;

namespace NHDao
{
    public interface IGenericDao<T,Id>
    {
        T FindByid(Id id);

        IList<T> FindAll();

        IList<T> FindAllOrdered(IList<string> propertyNames);

        IList<T> FindByExample(T entity);

        IList<T> FindBydExampleOrdered(T entity, IList<string> propertyNames);

        IList<T> FindLikeExample(T entity);

        IList<T> FindLikeExampleOrdered(T entity, IList<string> propertyNames);

        IList<T> FindLikeExampleIgnoreCase(T entity);

        IList<T> FindLikeExampleIgnoreCaseOrdered(T entity, IList<string> propertyNames);

        IList<T> FindByQuery(string query);

        IList<T> FindByQuery(string query, string[] parameters, object[] values);

        IList<T> FindByNamedQuery(string query);

        IList<T> FindByNamedQuery(string query, string[] parameters, object[] values);

        IList FindObjectsByQuery(string query);

        IList FindObjectsByNamedQuery(string query);

        IList FindObjectsByNamedQuery(string query, string[] parameteres, object[] values);

        IList FindObjectsBySQLQuery(string query, string[] parameters, object[] values);

        T Save(T entity);

        T Update(T entity);

        void MakeTransient(T entity);

        Id GetMax(string propertyName);

    }
}